﻿using DongHuMgmt.Bussiness.Abstract;
using DongHuMgmt.Bussiness.Concrete;
using DongHuMgmt.DataAccess;
using System.Data.Entity;
using System.Web.Mvc;
using Unity;
using Unity.AspNet.Mvc;

namespace DongHuMgmt.Web.Infrastructure
{
    public class UnityConfigure
    {
        public static void RegisterContainer()
        {
            UnityContainer container = new UnityContainer();

            container.RegisterType<ISysUserService, SysUserService>();
            //container.RegisterType<ISysDeptService, SysDeptService>();
            //container.RegisterType<ISysUserRepository, SysUserRepository>();
            //container.RegisterType<ISysDeptRepository, SysDeptRepository>();
            container.RegisterType<DbContext, DongHuContext>();

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
    }

}